package com.spark.lola.logistics.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.spark.lola.logistics.entity.CarSubscribe;
import com.spark.lola.logistics.entity.OrderInfo;
import com.spark.lola.support.common.entity.ShiroUser;
import com.spark.lola.support.mybatis.entity.QueryParam;
import com.spark.lola.support.mybatis.service.BaseService;

/**
 * @author: Zhi-peng wang
 * @date: 2020/05/11 19:35
 * 回头车预订业务接口
 **/
public interface CarSubscribeService extends BaseService<CarSubscribe> {

    IPage<CarSubscribe> findPage(QueryParam<CarSubscribe> queryParam);

    /**
     * @description: 添加回头车预订记录
     * @param: orderInfo 直达运输单信息
     * @param: shiroUser 驾驶员信息
     * @return: boolean 是否成功
     * @author: wzp
     * @date: 2020/5/12
     */
    boolean addCarSubscribe(OrderInfo orderInfo, ShiroUser shiroUser);

    /**
     * @description: 修改回头车预订记录状态
     * @param: driverId 驾驶员id
     * @return: boolean 是否成功
     * @author: wzp
     * @date: 2020/5/12
     */
    boolean updateCarSubscribeUsed(long driverId);

    /**
     * @description: 预订
     * @param: carSubscribeId 回头车预订记录id
     * @param: subscribeId 预订人id
     * @param: subscribeName 预订人姓名
     * @return: void
     * @author: wzp
     * @date: 2020/5/12
     */
    void subscriber(long carSubscribeId, String remark, long subscribeId, String subscribeName, ShiroUser shiroUser) throws Exception;

    void audio(long carSubscribeId, String msg, boolean isPass, ShiroUser shiroUser) throws Exception;

    /**
     * @description: 取消预订
     * @param: carSubscribeId 回头车预订记录id
     * @param: subscribeId 取消预订人id
     * @return: void
     * @author: wzp
     * @date: 2020/5/12
     */
    void cancel(long carSubscribeId, long subscribeId) throws Exception;

}
